// /** 游戏数据 */
// /** 调试 */

import { _decorator } from 'cc';

export class Minesweeper_GameData {
    //    // static W: number = Minesweeper_GameData.size * Minesweeper_GameData.col;
    //    // static H: number = Minesweeper_GameData.size * Minesweeper_GameData.row;
    static W: number = 600;
    static H: number = 600;
    static row: number = 9; // 行数
    static col: number = 9; // 列数
    static size: number = Minesweeper_GameData.W / Minesweeper_GameData.row; // 方块的尺寸
    static 雷数量: number = 10;
    static 已翻格子数: number = 0;
    //    // static arrGrids: any[][] = [];
    static arrGrids = [];
    static arrBlocks = [];
    static Score: number = 0;
    static 状态 = `扫雷`;
    static IsMouseDown: boolean = false;
    static colors = [
        { id: 2, color: "#FFF3E7", Label_color: "#424952" },
        { id: 4, color: "#FFEBCE", Label_color: "#424952" },
        { id: 8, color: "#FFC773", Label_color: "#424952" },
        { id: 16, color: "#FFA663", Label_color: "#FFFFFF" },
        { id: 32, color: "#FF8652", Label_color: "#FFFFFF" },
        { id: 64, color: "#FF5D52", Label_color: "#FFFFFF" },
        { id: 128, color: "#C6CB7B", Label_color: "#FFFFFF" },
        { id: 256, color: "#94CF94", Label_color: "#313031" },
    ];
    static isSlide: boolean = true;
    static direction;
    static gameState;
    static move_duration = 0.2;
    static InitData() {
        Minesweeper_GameData.Score = 0;
        Minesweeper_GameData.arrGrids = [];
        Minesweeper_GameData.arrBlocks = [];
    }
    static ClearData() {
        Minesweeper_GameData.Score = 0;
        Minesweeper_GameData.arrGrids = [];
        Minesweeper_GameData.arrBlocks = [];
    }
    static GetScore() {
        return Minesweeper_GameData.Score;
    }
    static SetScore(value) {
        Minesweeper_GameData.Score = value;
    }
    // static Add_score(_score) {
    //     let new_score = Minesweeper_GameData.Score + _score;
    //     Minesweeper_GameData.Update_score(new_score)
    // }
    // static Update_score(_score) {
    //     Minesweeper_GameData.Score = _score;
    //     if (S2048_GameStorage.data.high_score <= Minesweeper_GameData.Score) {
    //         S2048_GameStorage.data.high_score = Minesweeper_GameData.Score;
    //         S2048_GameStorage.saveData();
    //     }
    //     S2048_GamePanel.Instance.Refresh_score();
    // }
}

window["Minesweeper_GameData"] = Minesweeper_GameData;